<template>
    <div>
        <div class="hcb">
            <div v-for="(v,i) in arr" :key="i" @click="fun(v.glist[0].gid)">
                <img :src="v.glist[0].pic" alt="">
                <p>{{v.glist[0].gname}}</p>
                <br><br>
                <b>￥339</b>&nbsp;&nbsp;
                <span>50</span>
                <span>人喜欢</span>
            </div>
        </div>
    </div>
</template>

<script>
import {getlink} from "../../../api/getapi.js"
export default {
    data(){
        return{
            arr:[]
        }
    },
    methods:{
        fun(i){
          this.$router.push({path:"/xq",query:{dataid:i}})
        }
    },
    mounted(){
        getlink("/api/shop/findGoodsByLid?lid=11").then(ok=>{
            // console.log(ok.data);
            this.arr=ok.data;
            console.log(this.arr);
            
        })
    }
}
</script>

<style>
.hcb{
    width: 90%;
    margin: auto;
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.hcb div{
    width: 45%;
}
.hcb div img{
    width: 100%;
}
.hcb div p{
    font-size: 0.26rem;
}
.hcb div b{
    font-size: 0.26rem;
}
</style>
